package com.shuyu.common.core.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.shuyu.common.utils.DesCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
@ApiModel(description = "用户")
@TableName("tbl_customer")
public class Customer implements Serializable {
    private static final long serialVersionUID = 3547662534455538787L;
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @ApiModelProperty(value = "用户名")
    private String username;
    @ApiModelProperty(value = "微信昵称")
    private String nickname;
    @ApiModelProperty(value = "注册来源(0:微信  1:大友)")
    private Integer source;
    @JsonIgnore
    @ApiModelProperty(value = "第三方来源关联用户ID")
    private Integer thirdId;
    @JsonIgnore
    @ApiModelProperty(value = "加密盐值")
    private String saltVal;
    @ApiModelProperty(value = "性别 0未知 1男 2女")
    private Integer sex;
    @ApiModelProperty(value = "省")
    private String province;
    @ApiModelProperty(value = "市")
    private String city;
    @ApiModelProperty(value = "区")
    private String districts;
    @ApiModelProperty(value = "详细地址")
    private String addressDetail;
    @ApiModelProperty(value = "身份证号")
    private String idCard;
    @ApiModelProperty(value = "真实姓名")
    private String realName;
    @ApiModelProperty(value = "手机号")
    private String mobile;
    @JsonIgnore
    @ApiModelProperty(value = "钱包地址")
    private String wallet;
    @JsonIgnore
    @ApiModelProperty(value = "私钥")
    private String privateKey;

    private Date createTime;
    private Date modifiedTime;
    private Integer delFlag;
    @ApiModelProperty(value = "积分")
    private Integer point;
    @ApiModelProperty(value = "头像")
    private String headimgurl;
    @ApiModelProperty(value = "NFT")
    private String nft;
    @ApiModelProperty(value = "MV")
    private String mv;
    @ApiModelProperty(value = "卡牌")
    private String card;
    @ApiModelProperty(value = "内部资产")
    private String internalAssets;
    @ApiModelProperty(value = "外部资产")
    private String externalAssets;

    public Customer() {
    }

    public Customer(String username, String nickname, Integer source, Integer thirdId, String saltVal, String wallet, String privateKey, String headimgurl, Date createTime) {
        this.username = username;
        this.nickname = nickname;
        this.source = source;
        this.thirdId = thirdId;
        this.saltVal = saltVal;
        this.wallet = wallet;
        this.privateKey = privateKey;
        this.headimgurl = headimgurl;
        this.createTime = createTime;
    }

    public String getNickname() {
        return DesCode.decryptor(nickname);
    }

    public String getProvince() {
        return DesCode.decryptor(province);
    }

    public String getCity() {
        return DesCode.decryptor(city);
    }

    public String getDistricts() {
        return DesCode.decryptor(districts);
    }

    public String getAddressDetail() {
        return DesCode.decryptor(addressDetail);
    }

    public String getIdCard() {
        return DesCode.decryptor(idCard);
    }

    public String getRealName() {
        return DesCode.decryptor(realName);
    }

    public String getMobile() {
        return DesCode.decryptor(mobile);
    }
}
